htmlwidgets: Un marco para embeber visualizaciones de JavaScript en R
Hèctor Perpiñán Fabuel
Servei d’Eficiencia i Anàlisi Econòmic - Conselleria de Sanitat Universal i Salut Pública
Máster en Bioestadística (Universitat de València) - 14 de diciembre de 2022
127 widgets registrados actualmente (selección):
leaflet: Mapeado geoespacial interactivo
plotly: Creación de gráficos interactivos
dygraphs: Graficado de series temporales
DataTables: Visualización de datos tabulares
d3heatmap: Mapas de calor
networkD3: Visualización gráfica de datos con D3
DiagrammeR: Grafos y diagramas de flujo
rglwidget: Renderiza escenas creadas con rgl
renderLeaflet() y leafletOutput()renderPlotly() y plotlyOutput()renderDygraph() y dygraphOutput()renderDataTable() y dataTableOutput()renderD3heatmap() y d3heatmapOutput()renderForceNetwork() y forceNetworkOutput()library(DiagrammeR)
grViz("
digraph boxes_and_circles {
node [shape = polygon
sides = 6
fontname = Helvetica
penwidth = 2.0
width = 2.0]
ICTUS1 [label = 'ICTUS\nBarcelona']; ICTUS2 [label = 'ICTUS\nLleida']; ICTUS3 [label = 'ICTUS\nBellvitge'];
node [shape = circle
fontname = Helvetica
penwidth = 2.0
width = 1.0]
Aleatorización [color = pink, style = filled]
node [shape = box]
Barcelona; Bellvitge; Lleida; SEM;Intervención; Control
node [shape = ellipse]
'RACE 1-3'; 'RACE 4-6'; 'RACE 7-9';
ICTUS1 -> SEM; ICTUS2 -> SEM; ICTUS3 -> SEM;
SEM -> 'RACE 1-3'; SEM -> 'RACE 4-6'; SEM -> 'RACE 7-9' [label = 'ambulancia'];
'RACE 1-3' -> SEM; 'RACE 4-6' -> SEM; 'RACE 7-9' -> SEM;
SEM -> Aleatorización;
Aleatorización -> Intervención; Aleatorización -> Control;
Intervención -> Barcelona; Intervención -> Bellvitge; Intervención -> Lleida;
Control -> Barcelona; Control -> Bellvitge; Control -> Lleida;
graph [nodesep = 0.1]
}
", height = 500)library(rgl); library(rglwidget); library(htmltools)
theta <- seq(0, 6*pi, len = 100)
xyz <- cbind(sin(theta), cos(theta), theta)
lineid <- plot3d(xyz, type = "l", alpha = 1:0, lwd = 5,
col = "blue")["data"]
browsable(tagList(
rglwidget(elementId = "example", width = 500,
height = 400, controllers = "player"),
playwidget("example", ageControl(births = theta,
ages = c(0, 0, 1),
objids = lineid,
alpha = c(0, 1, 0)),
start = 1, stop = 6*pi,
step = 0.1, rate = 6,
elementId = "player")))y extensiones con crosstalk.